#!/bin/bash

# This simple script returns the modification date of the file most recently modified

ls -lt /var/www/map | head -2 | grep -o '[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}' > ~/map_files/index_date_modified

# We also have to get the modification date of other, specific files.
# I should make this a for loop

ls -l /var/www/map/login.php | grep -o '[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}' > ~/map_files/login_date_modified
ls -l /var/www/map/oo_stats/archives.php | grep -o '[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}' > ~/map_files/archives_date_modified
ls -l /var/www/map/oo_stats/oo_stats.php | grep -o '[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}' > ~/map_files/oo_stats_date_modified
ls -l /var/www/map/validate.php | grep -o '[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}' > ~/map_files/validate_date_modified
ls -l /var/www/map/checklabs.php | grep -o '[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}' > ~/map_files/checklabs_date_modified

exit 0
